#ifndef __MYLOG_H__
#define __MYLOG_H__

#include <sys/types.h>
#include <sys/stat.h>
#include <fcntl.h>
#include <unistd.h>
#include <time.h>

class MyLog {
public:
    int writeLog(const char *str);
    int writeErrorLog(const char *str);
    int printLog(const char *fmt, ...);
private:
    int LogFd = -1;
    int ErrorLogFd = -1;
    time_t RunTime;
    char FileName[32] = "./Run/xxx_2000-00-00_00:00.log";

private:
    static MyLog *mPOOL;
    MyLog();
    ~MyLog();
    MyLog(const MyLog&) = delete;
    MyLog &operator=(const MyLog&) = delete;
public: 
    static MyLog *getInstance();
    MyLog &operator<<(const char *str);

};








#endif //__MYLOG_H__